package day15;

/**
 * 销售人员类
 * 在基本工资基础上每月还有销售提成
 */
public class Salesman extends Employee {
    // 基本工资
    private double baseSalary;
    
    // 销售提成
    private double commission;
    
    /**
     * 构造方法
     * @param name 员工姓名
     * @param gender 员工性别
     * @param birthDate 员工出生日期
     * @param baseSalary 基本工资
     * @param commission 销售提成
     */
    public Salesman(String name, String gender, String birthDate, double baseSalary, double commission) {
        super(name, gender, birthDate, "销售员");
        this.baseSalary = baseSalary;
        this.commission = commission;
    }
    
    /**
     * 计算销售员工资
     */
    @Override
    public void computeSalary() {
        double salary = baseSalary + commission;
        System.out.println("销售员 " + name + " 本月工资为 " + salary + " 元。");
    }
    
    // baseSalary的getter和setter方法
    public double getBaseSalary() {
        return baseSalary;
    }
    
    public void setBaseSalary(double baseSalary) {
        this.baseSalary = baseSalary;
    }
    
    // commission的getter和setter方法
    public double getCommission() {
        return commission;
    }
    
    public void setCommission(double commission) {
        this.commission = commission;
    }
}